<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/jquery-1.10.1.js" ></script>
    <script>
        $(document).ready(function(){
            //  $(选择器) 获取了jq对象
            // $().attr(); 2个参数是赋值， 1个参数是取值
            $("form > input").attr("placeholder", "值1")

           /*for (var i = 0; i < document.getElementsByTagName("form").length; i++) {
               var n = document.getElementsByTagName("form")[i];
                for (let j = 0; j <     n.children.length; j++) {
                    let m = n.children[j];
                    if (m.nodeName == 'INPUT') {
                        m.setAttribute('placeholder', '值1')
                        m.style.backgroundColor=red;
                    }
                }
           }*/

           $("label + input").css("background-color", "red");
        
           // value属性 1个参数是赋值， 无参数是取值
           $("form ~ input").val("弟弟")
        })
    </script>
</head>
<body>
    <input name="none" />
    <form>
        <input name="newsletter" />
        <label>Name:</label>
        <input name="name" />
        <fieldset>
            <label>Newsletter:</label>
            <input name="newsletter" />
       </fieldset>
      </form>
      <input name="none" />
      <hr />
      <input name="none" />
</body>
</html>